<template>
<div>
  <van-nav-bar title="商品详情" left-text="返回" left-arrow @click-left="onClickLeft" fixed />
  <div class="header">
    <img src="//img1.qunarzz.com/sight/p0/1812/82/820670c947d2eb92a3.img.jpg_256x160_faed9433.jpg">
  </div>
  <div class="info">
    <div class="info-name">大番薯</div>
    <div class="info-desc">大番薯天又天，大家都爱吃</div>
    <div class="info-time">发布时间：2020-10-20</div>
  </div>
  <div class="item">
    <div class="company-info">
      <img class="company-logo" src="@/assets/img/店铺.png">
      <div class="company-head">
        <div class="company-name">
          <div class="name-text">李连杰</div>
          <div class="type-text">供应商</div>
        </div>
        <div class="star-container">
          <div class="star-text">平台认证：</div>
          <van-rate v-model="value" readonly />
        </div>
      </div>
    </div>
    <div class="other-btn">
      <div class="enter-btn" catchtap="navToShopDetail">进入商铺</div>
      <div class="about-btn" bindtap="navToCompanyDetail">关于我们</div>
      <div class="collect-btn">
        <img class="collect-img" src="@/assets/img/店铺收藏.png">
        <div>收藏店铺</div>
      </div>
    </div>
  </div>
  <van-divider dashed>商品详情</van-divider>
  <div class="detail">
    <div class="detail-title">商品参数</div>
    <div class="detail-item">
      <div class="detail-name">产地</div>
      <div class="detail-desc">北京</div>
    </div>
    <div class="detail-item">
      <div class="detail-name">联系人</div>
      <div class="detail-desc">李白</div>
    </div>
    <div class="detail-item">
      <div class="detail-name">联系电话</div>
      <div class="detail-desc">1354785442</div>
    </div>
    <div class="detail-item">
      <div class="detail-name">净含量</div>
      <div class="detail-desc">见商品外包装</div>
    </div>
  </div>
  <div class="dibider">
    <van-divider :style="{ color: '#f7f8fa;', borderColor: '#f7f8fa;', padding: '0 16px' }">
      到底啦
    </van-divider>
  </div>
  <van-goods-action>
    <van-goods-action-icon icon="chat-o" text="客服" />
    <van-goods-action-icon icon="shop-o" text="店铺" />
    <van-goods-action-button color="#FF9068" type="warning" text="加入收藏" @click="onClickCollect" />
    <van-goods-action-button color="#FF4B1F" type="danger" text="立即购买" @click="onClickButton" />
  </van-goods-action>

</div>
</template>

<script>
import {
  Toast,
  Dialog
} from 'vant';
export default {
  name: "recommendDetail",
  data() {
    return {
      value: 3,
    };
  },
  methods: {
    onClickLeft() {
      this.$router.push({
        name: 'home'
      })
    },
    onClickCollect() {
      Toast('收藏成功！');
    },
    onClickButton() {
      Dialog.confirm({
          title: '提示',
          message: '该App暂时不提购买服务，是否跳转到对应的淘宝购买链接！',
        })
        .then(() => {
          // on confirm
        })
        .catch(() => {
          // on cancel
        });
    },
  },
}
</script>

<style scoped>
.dibider {
  width: 375px;
  height: 100px
}

.header {
  width: 355px;
  height: 200px;
  border-radius: 5px;
  overflow: hidden;
  margin: 10px auto;
  margin-top: 55px;
}

.header img {
  width: 355px;
  height: 100%;
}

.info,
.detail {
  width: 335px;
  margin-left: 10px;
  background: #FFFFFF;
  box-shadow: 0px 3px 14px rgba(78, 112, 184, 0.07);
  border-radius: 8px;
  padding: 10px
}

.info-name {
  font-size: 15px;
  font-weight: 800;
  color: #000000;
  overflow: hidden;
}

.info-desc {
  font-size: 13px;
  font-weight: 800;
  color: #525151;
  overflow: hidden;
  margin-top: 8px;
}

.info-time {
  font-size: 12px;
  color: #525151;
  overflow: hidden;
  margin-top: 8px;
  color: #FF4B1F
}

.item {
  margin-top: 20px;
  width: 335px;
  margin-left: 10px;
  background: #FFFFFF;
  box-shadow: 0px 3px 14px rgba(78, 112, 184, 0.07);
  border-radius: 8px;
  padding: 10px
}

.company-info {
  display: flex;
  width: 335px;
  margin-left: 10px;
  margin-top: 10px;
}

.company-logo {
  width: 50px;
  height: 50px;
}

.company-head {
  width: 245rpx;
}

.company-name {
  display: flex;

  margin-left: 10px;
  align-items: center;

}

.name-text {
  font-size: 16px;
  font-weight: bold;
  color: #222222;
  line-height: 24px;

}

.type-text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 16px;
  margin-left: 5px;
  font-size: 10px;
  font-weight: 500;
  color: #FFFFFF;
  line-height: 24px;
  background: linear-gradient(90deg, #FF4B1F, #FF9068);
  border-radius: 2px;
}

.star-container {
  display: flex;
  align-items: center;
  width: 200px;
  height: 28px;
  margin-top: 10px;
  margin-left: 10px;
  background: #F2F2F2;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #222222;
  box-sizing: border-box;

}

.star-text {
  margin-left: 10px;

}

.other-btn {
  align-items: center;
  width: 355px;
  margin-top: 20px;
  display: flex;
}

.enter-btn,
.about-btn {
  align-items: center;
  justify-content: center;
  background: #FFFFFF;
  border: 1px solid #999999;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 500;
  color: #222222;
  line-height: 17px;

}

.enter-btn,
.about-btn,
.collect-btn {
  display: flex;
  margin-left: 20px;
  width: 87px;
  height: 26px;

}

.collect-btn {
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #FF4B1F, #FF9068);
  border-radius: 13px;
  font-size: 13px;
  color: #FFFFFF;
  line-height: 10px;
}

.collect-img {
  width: 16px;
  height: 16px;
}

.detail-title {
  font-size: 12px;
  font-weight: bold;
  line-height: 17px;
  color: #6A6F7A;
}

.detail-item {
  display: flex;
  flex-direction: row;
  margin-top:10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f3f3f3;
}

.detail-name {
  width:100px;
  font-size: 13px;
  line-height: 17px;
  color: #6A6F7A;
}

.detail-desc {
  font-size: 14px;
  line-height: 17px;
  color: #000000;
}
</style>
